package com.meisupic.copyright.domain.po;

import java.math.BigDecimal;
import java.sql.Timestamp;
import java.util.Objects;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;

@Entity
@Table(name = "copyright_member_category")
public class MemberCategoryPo {

  private Long id;
  private String categoryName;
  private BigDecimal price;
  private BigDecimal discountPrice;
  private Integer serviceTotal;
  private Timestamp createTime;
  private Timestamp modifyTime;

  @Id
  @Column(name = "id", nullable = false)
  public Long getId() {
    return id;
  }

  public void setId(Long id) {
    this.id = id;
  }

  @Basic
  @Column(name = "category_name", nullable = false, length = 50)
  public String getCategoryName() {
    return categoryName;
  }

  public void setCategoryName(String categoryName) {
    this.categoryName = categoryName;
  }

  @Basic
  @Column(name = "price", nullable = false)
  public BigDecimal getPrice() {
    return price;
  }

  public void setPrice(BigDecimal price) {
    this.price = price;
  }

  @Basic
  @Column(name = "discount_price", nullable = false)
  public BigDecimal getDiscountPrice() {
    return discountPrice;
  }

  public void setDiscountPrice(BigDecimal discountPrice) {
    this.discountPrice = discountPrice;
  }

  @Basic
  @Column(name = "service_total", nullable = false)
  public Integer getServiceTotal() {
    return serviceTotal;
  }

  public void setServiceTotal(Integer serviceTotal) {
    this.serviceTotal = serviceTotal;
  }

  @Basic
  @Column(name = "create_time", nullable = false)
  public Timestamp getCreateTime() {
    return createTime;
  }

  public void setCreateTime(Timestamp createTime) {
    this.createTime = createTime;
  }

  @Basic
  @Column(name = "modify_time", nullable = false)
  public Timestamp getModifyTime() {
    return modifyTime;
  }

  public void setModifyTime(Timestamp modifyTime) {
    this.modifyTime = modifyTime;
  }

  @Override
  public boolean equals(Object o) {
    if (this == o) {
      return true;
    }
    if (o == null || getClass() != o.getClass()) {
      return false;
    }
    MemberCategoryPo that = (MemberCategoryPo) o;
    return Objects.equals(id, that.id) &&
        Objects.equals(categoryName, that.categoryName) &&
        Objects.equals(price, that.price) &&
        Objects.equals(discountPrice, that.discountPrice) &&
        Objects.equals(serviceTotal, that.serviceTotal) &&
        Objects.equals(createTime, that.createTime) &&
        Objects.equals(modifyTime, that.modifyTime);
  }

  @Override
  public int hashCode() {

    return Objects
        .hash(id, categoryName, price, discountPrice, serviceTotal, createTime, modifyTime);
  }
}
